@@ 21,7 21,7 @@ static char lastid[32];
int debug, nopresence, nohistory, plainallow;
Biobuf kbin;
-char *server, *mydomain, *myjid, *mynick, *myresource;
+char *server, *mydomain, *myjid, *mynick, *myresource, *myplainjid;
static QLock prlock;
static void
@@ 59,7 59,8 @@ inmsg(Xelem *x)
return;
to = xmlgetattr(x->a, "to");
- if(to != nil && strncmp(to->v, myjid, strlen(myjid)) != 0)
+ if(to != nil && strncmp(to->v, myjid, strlen(myjid)) != 0 &&
+ strncmp(to->v, myplainjid, strlen(myplainjid) != 0))
return;
if((delay = xmlget(x->ch, "delay")) == nil)
@@ 475,6 476,10 @@ threadmain(int argc, char **argv)
if(argc != 1)
usage();
myjid = strdup(argv[0]);
+ /* myjid will get set later to a value given by the server,
+ * but sometimes that value isn't used, so we also
+ * check against the old value */
+ myplainjid = strdup(myjid);
quotefmtinstall();
fmtinstall('H', encodefmt);