index.jsView |
---|
458 | 458 … | console.log(this.req.method, this.req.url, this.req.socket.remoteAddress.replace(/^::ffff:/, '')) |
459 | 459 … | this.res.setTimeout(0) |
|
460 | 460 … | var pathname = this.req.url.replace(/\?.*/, '') |
461 | 461 … | var m |
462 | | - if ((m = /^\/(\^|%5[Ee])?(%25.*sha256)(\/.*)$/.exec(pathname))) { |
| 462 … | + if ((m = /^\/(\^|%5[Ee])?(%25.*sha256)+(\/.*)$/.exec(pathname))) { |
463 | 463 … | try { |
464 | | - this.headMsgId = decodeURIComponent(m[2]) |
| 464 … | + this.headMsgIds = decodeURIComponent(m[2]).split(',') |
465 | 465 … | this.headMsgPlus = !!m[1] |
466 | 466 … | |
467 | 467 … | } catch(e) { |
468 | 468 … | return this.respondError(400, e.stack || e) |
519 | 519 … | } |
520 | 520 … | |
521 | 521 … | Req.prototype.getMsgMentions = function (name) { |
522 | 522 … | return pull( |
523 | | - this.server.streamTree([this.headMsgId], 'dependencyBranch'), |
| 523 … | + this.server.streamTree(this.headMsgIds, 'dependencyBranch'), |
524 | 524 … | |
525 | 525 … | pull.map(function (msg) { |
526 | 526 … | var c = msg.value && msg.value.content |
527 | 527 … | if (!c.mentions || !Array.isArray(c.mentions)) return [] |
546 | 546 … | ) |
547 | 547 … | } |
548 | 548 … | |
549 | 549 … | Req.prototype.getMentions = function (name) { |
550 | | - var useMsgMentions = this.headMsgId |
551 | | - var useServerMentions = !this.headMsgId || this.headMsgPlus |
| 550 … | + var useMsgMentions = this.headMsgIds |
| 551 … | + var useServerMentions = !this.headMsgIds || this.headMsgPlus |
552 | 552 … | if (useServerMentions && !this.server.sbot.links2) { |
553 | 553 … | return this.headMsgPlus |
554 | 554 … | ? pull.error(new Error('ssb-links scuttlebot plugin is needed for ^msgid queries')) |
555 | 555 … | : pull.error(new Error('ssb-links scuttlebot plugin is needed for non-msgid queries')) |
561 | 561 … | } |
562 | 562 … | |
563 | 563 … | Req.prototype.getMentionLinks = function (blobId) { |
564 | 564 … | return pull( |
565 | | - this.headMsgId |
566 | | - ? this.server.streamTree([this.headMsgId], 'dependencyBranch') |
| 565 … | + this.headMsgIds |
| 566 … | + ? this.server.streamTree(this.headMsgIds, 'dependencyBranch') |
567 | 567 … | : this.server.sbot.links({ |
568 | 568 … | dest: blobId, |
569 | 569 … | rel: 'mentions', |
570 | 570 … | values: true, |